Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AYR-1386 - File download timeout #712

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ltrasca
Copy link
Collaborator

@ltrasca ltrasca commented Dec 18, 2024

Changes in this PR

  • Replaced previous file transfer logic with a redirect towards a presigned url for the file

JIRA ticket

https://national-archives.atlassian.net/browse/AYR-1386

@ltrasca ltrasca requested a review from colinbowen December 18, 2024 18:55
@ltrasca ltrasca self-assigned this Dec 18, 2024
Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.55%. Comparing base (e95284c) to head (f1cbd8d).
Report is 153 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (e95284c) and HEAD (f1cbd8d). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (e95284c) HEAD (f1cbd8d)
2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #712       +/-   ##
===========================================
- Coverage   94.29%   58.55%   -35.74%     
===========================================
  Files          20        8       -12     
  Lines        1174      263      -911     
===========================================
- Hits         1107      154      -953     
- Misses         67      109       +42     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

And the file should contain the expected content
And the downloaded filename should be the File's CiteableReference with extension
"""
""" """
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function name for this pretty clear, I still think that having a docstring here would be useful.

And the file should contain the expected content
And the downloaded filename should be the filename with extension
"""
""" """
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here for the docstring.

abort(500)

content_type = s3_file_object.get("ContentType", "application/octet-stream")

if render:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition block was already redundant anyway wasn't in, since we moved render to use presigned urls directly.

@@ -38,17 +38,10 @@ def test_invalid_id_raises_404(self, client: FlaskClient):
assert response.status_code == 404

@mock_aws
def test_download_record_standard_user_with_citable_reference_with_file_extension(
Copy link
Contributor

@anthonyhashemi anthonyhashemi Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still need the test cases for citable_reference_with_file_extension and citable_reference_without_file_extension unless we move the logic for the downloaded_filename into a helper function and test that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants